﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ViewOnCore.Helper.Debug;

namespace ViewOnCore.AddIn
{
    // Summary:
    //     Identifies an object as an add-in.
    [AttributeUsage(AttributeTargets.Class)]
    public sealed class AddInAttribute : Attribute
    {

        #region Variables

        private string _description;
        private string _name;
        private string _publisher;
        private string _version;

        #endregion

        #region AddInAttribute

        public AddInAttribute(string name)
        {
            LogManager.Requires((name != null) ? null : ((Exception)new ArgumentNullException("name")));
            LogManager.Requires((name.Length > 0) ? null : ((Exception)new ArgumentException("name is empty")));
            _name = name;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Describe the Add in.
        /// </summary>
        public string Description
        {
            get
            {
                return _description;
            }
            set
            {
                _description = value;
            }
        }

        /// <summary>
        /// The Add in name.
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
        }

        /// <summary>
        /// The Add in's publisher name.
        /// </summary>
        public string Publisher
        {
            get
            {
                return _publisher;
            }
            set
            {
                _publisher = value;
            }
        }

        /// <summary>
        /// The Add in's version
        /// </summary>
        public string Version
        {
            get
            {
                return _version;
            }
            set
            {
                _version = value;
            }
        }

        #endregion

    }
}
